package pc29;

import java.util.Scanner;

public class J05NestedLoop {
	public static void main(String[] args) {

		// 구구단 작성
		// for, while, do-while 문으로 작성해보장

		int i = 1, j = 1;
		int k = 1, l = 1;
		int n = 1, m = 1;
		
/*
		// for문 두번써서 구구단
		for (i = 1; i < 10; i++) {
			System.out.println(" for문 " + i + "단");
			for (j = 1; j < 10; j++) {
				System.out.println(" " + i + " X " + j + " = " + i * j);
			}
		}
		
		// while문 두번써서 구구단
		while (k < 10) {
			System.out.println(" while문 " + k + "단");
			while (l < 10) {
				System.out.println(" " + k + " X " + l + " = " + k * l);
				l++;
			}
			l = 1;
			k++;
		}
		
		// do-while문 두번써서 구구단
		do {
			System.out.println(" do-while문 " + n + "단");
			do{
				System.out.println(" " + n + " X " + m + " = " + n * m);
				m++;
			}while(m < 10);
			m = 1;
			n++;
		} while (n < 10);
*/
/*
		for(i=1; i<10; i++){
			for(j=1; j<10; j++){
			System.out.print(j+" x "+ i + " = "+ i*j + "\t");
			}
			System.out.print("\n");
		}
*/
/*
		while(k<10){
			while(l<20){
				System.out.print("\t"+ l + "x" + k + "=" + l*k + " \t ");
			l++;
			}
			l=1;
			k++;
			System.out.print("\n");
		}
*/

		do{
			do{
				System.out.print("\t"+ n + "x" + m + "=" + n*m + " \t ");
				n++;
			}while(n<20);
			n=1;
			m++;
			System.out.print("\n");
		}while(m<10);
		
	}
}
